import java.io.*;

public class Radix
{
	public static void main(String[]args)throws IOException
	{
		FileReader fileObj=new FileReader(args[0]);
		BufferedReader buffRead=new BufferedReader(fileObj);
		int numberOfElement=0;                                    
		String inputString=buffRead.readLine();
		String [] inputArray=inputString.split("\\,");
                 		for(String i:inputArray)
		{	
			numberOfElement++;		//number of integers in file
		}

		int arrayToSort[]=new int[numberOfElement];
		int count=0;
		for(String j:inputArray)
		{
			arrayToSort[count]=Integer.parseInt(j);      //convert string to integer
			count++;	
		}

	//display elements in file on console
		System.out.println("Elements to sort are:");
		for(int iPrint=0;iPrint<numberOfElement;iPrint++)
		{
			System.out.println(arrayToSort[iPrint]+"\t");    
		}
		int maxNum=arrayToSort[0], exp=1;
	//find greatest number from given input
		for(int iMax=0;iMax<numberOfElement;iMax++)
		{	
			if(arrayToSort[iMax]>maxNum)                                  
				maxNum=arrayToSort[iMax];
		
		}	
		int tempArray[]=new int[10];
		int ouputArray[]=new int[numberOfElement];
	
		while(maxNum/exp>0)
		{
		//initialize array wid zero
			for(int iInitialize=0;iInitialize<10;iInitialize++)
			{
				tempArray[iInitialize]=0;
			}
		//count of the elements having same unit,tens,...etc place and insert into appropriate array index
			for(int i=0;i<numberOfElement;i++)
			{
				tempArray[(arrayToSort[i]/exp)%10]++;
			}
		

		//add previous array index count to next count.....to fix the position of the intergers(order of integers) 
			for(int i=1;i<10;i++)
			{
				tempArray[i]+=tempArray[i-1];
			}
			int iOutputArray;
		//place the element into the output array as per the tempArray arry index count 
			for(int iIndex=numberOfElement-1;iIndex>=0;iIndex--)
			{
				iOutputArray=--(tempArray[(arrayToSort[iIndex]/exp)%10]);
				 ouputArray[iOutputArray]=arrayToSort[iIndex];
			
			}
		//to consider newly created array for next iteration 
			for(int i=0;i<numberOfElement;i++)
			{
				arrayToSort[i]=ouputArray[i];       
			}
			exp*=10;     //for calculating tens, hundreds, thousands place' number
		}
	//display sorted elements 
		System.out.println("Sorted elements are:");
		for(int iPrint=0;iPrint<numberOfElement;iPrint++)
		{
			System.out.println(arrayToSort[iPrint]+"\t");
		}
	}
}